# $Id$
# Maintainer: Jan de Groot <jgc@archlinux.org>
# Maintainer: Tom Gundersen <teg@jklm.no>
# Contributor: Thomas Baechler <thomas@archlinux.org>
# Contributor: Sarah Hay <sarahhay@mb.sympatico.ca>

pkgname=a52dec
pkgver=0.7.4
pkgrel=9
pkgdesc="A free library for decoding ATSC A/52 streams"
url="http://liba52.sourceforge.net/"
arch=('i686' 'x86_64')
license=('GPL2')
depends=('glibc')
source=("http://liba52.sourceforge.net/files/${pkgname}-${pkgver}.tar.gz"
        'a52dec-0.7.4-build.patch'
        'stderr.patch')
md5sums=('caa9f5bc44232dc8aeea773fea56be80'
         'fa16f224a7dceb7613824380abef0052'
         '52f57e003259a24516eaab08b64ae703')

prepare() {
  cd "${pkgname}-${pkgver}"
  patch -Np1 -i ../a52dec-0.7.4-build.patch
  patch -Np1 -i ../stderr.patch
  sed -i 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/' configure.in
  mv configure.in configure.ac
  ./bootstrap
}

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr --enable-shared
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  make DESTDIR="${pkgdir}" install
  install -m644 liba52/a52_internal.h "${pkgdir}/usr/include/a52dec/"
}
